<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="vue.js"></script>
</head>
<body>
    <div id="app">
        <a href="#" @click.prevent="flag?flag:flag=!flag">登录</a>
        <a href="#" @click.prevent="flag?flag=!flag:flag">注册</a>
        <login v-if="flag"></login>
        <reg v-else=""></reg>
    </div>

</body>
<script>
    //登录组件
    Vue.component("login",{
        template:"<div>登录页面</div>",
        //账号和密码
    })
    //注册组件
    Vue.component("reg",{
        template:"<div>注册页面</div>",
        //账号，邮箱，密码，确认密码，手机号
    })
    var vm = new Vue({
        el:"#app",
        data:{
            flag:true,
        }
    })
</script>
</html>